//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.chzu.dao;

import oracle.sql.CLOB;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.trans.Trans;

import java.io.BufferedReader;
import java.sql.ResultSet;
import java.util.List;

public class DBObject {
    private static final Log log = Logs.get();

    public DBObject() {
    }

    public static String getClobBody(ResultSet rs, String colnumName) {
        String result = "";

        try {
            String str_Clob = "";
            StringBuffer strBuffer_CLob = new StringBuffer();
            strBuffer_CLob.append("");
            CLOB clob = (CLOB)rs.getClob(colnumName);
            BufferedReader in = new BufferedReader(clob.getCharacterStream());

            while((str_Clob = in.readLine()) != null) {
                strBuffer_CLob.append(str_Clob + "\n");
            }

            in.close();
            result = strBuffer_CLob.toString();
        } catch (Exception var7) {
            log.debug(var7.getMessage());
        }

        return result;
    }

    public boolean exectmoresql(Dao dao, List sql) {
        boolean returnsuccess = true;

        try {
            Trans.begin();

            for(int a = 0; a < sql.size(); ++a) {
                dao.execute(Sqls.create(String.valueOf(sql.get(a))));
            }

            Trans.commit();
            returnsuccess = true;
        } catch (Exception var16) {
            try {
                Trans.rollback();
            } catch (Exception var15) {
                var15.printStackTrace();
            }

            var16.printStackTrace();
            returnsuccess = false;
        } finally {
            try {
                Trans.close();
            } catch (Exception var14) {
                var14.printStackTrace();
            }

        }

        return returnsuccess;
    }
}
